import { io } from 'socket.io-client'
const socket = io('', {
  path: '/api-server/socket.io',
})
export const socketId = ref()
export const messages = ref<any[]>([])
socket.on('connect', () => {
  socketId.value = socket.id
})
socket.on('message', (message) => {
  messages.value.push(message)
})
export const sendMessage = (message: string) => {
  socket.emit('message', message)
}
